package com.zhiyou100.service;

import com.zhiyou100.entity.Student;
import com.zhiyou100.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author yang
 * @className StudentImpl
 * @packageName com.zhiyou100.service
 * @Description TODO student 实现类
 * @date 2020-08-26 10:28
 */
@Repository
public class StudentImpl implements StudentService {
    private StudentMapper studentMapper;

    @Autowired
    public void setStudentMapper(StudentMapper studentMapper) {
        this.studentMapper = studentMapper;
    }


    @Override
    public List<Student> listStudents() {
        return studentMapper.listStudents();
    }

    @Override
    public void addOne(Student student) {
        System.out.println("hello");


    }

    @Override
    public Student getOneBySname(String sname) {
        return studentMapper.selectOneBySname(sname);
    }

    @Override
    public void changeSpwd(Student student) {
        studentMapper.updateSpwd(student);
    }
}
